﻿using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections;
using System.Text;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class PopWin_projectdetails : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            tablebind();
        }
    }
    protected void tablebind()
    {
        if (Request.QueryString["pid"].ToString()==null)
        {
            return;
        }
        else
        {
           string id = Request.QueryString["pid"].ToString();
            if (id!=null)
            {
                SqlParameter[] parameter ={ new SqlParameter("@id", SqlDbType.VarChar) };
                parameter[0].Value = id;
                string str = "select * from View_Projects where id=@id";
                SqlDataReader reader = PM.Code.DAL.DbHelper.ExecuteDataReaderBySql(str, parameter);
                while(reader.Read())
                {
                    //填写表格
                    lblSBLX.Text = reader[1].ToString();
                    lblXMJB.Text = reader[4].ToString();
                    lblPSFS.Text = reader[5].ToString();
                    lblXMLX.Text = reader[6].ToString();
                    if (reader[8].ToString()=="1")
                    {  
                        lblXMXZ.Text="本科";
                    }
                    else
                    {
                        lblXMXZ.Text = "专科";
                    }
                    lblXKM.Text = reader[9].ToString();
                    lblXKYJL.Text = string.IsNullOrEmpty(reader[10].ToString()) ? "" : reader[10].ToString();
                    lblSSXY.Text = reader[12].ToString();
                    lblZYDM.Text = string.IsNullOrEmpty(reader[18].ToString()) ? "" : reader[18].ToString();
                    lblTJSJ.Text = reader[17].ToString();
                    lblJZW.Text = reader[7].ToString();
                    lblGH.Text = reader[21].ToString();
                    lblXM.Text = reader[19].ToString();
                    lblZC.Text = reader[20].ToString();
                    lblXYBM.Text = reader[22].ToString();
                    lblSJ.Text = reader[23].ToString();
                    lblMAIL.Text = string.IsNullOrEmpty(reader[24].ToString()) ? "" : reader[24].ToString();
                    if (string.IsNullOrEmpty(reader[16].ToString()))
                    {
                        hlFJ.Text="未上传附件";
                        hlFJ.Enabled=false;
                    } 
                    else
                    {
                        hlFJ.Text = "下载";
                        hlFJ.NavigateUrl = reader[16].ToString();
                    }
                    lblBZ.Text = string.IsNullOrEmpty(reader[13].ToString()) ? "" : reader[13].ToString();
                }
                reader.Close();
            }
        }
    }
}
